package com.example.pageability;

import com.example.pageability.slice.OtherPageAbilitySliceDetail;
import com.example.pageability.slice.OtherPageAbiltySlice;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;

public class OtherPageAbilty extends Ability {
    // 用来进行Log输出
    static final HiLogLabel LABEL = new HiLogLabel(HiLog.LOG_APP, 0x0024, "MY_TAG");

    @Override
    public void onStart(Intent intent) {
        HiLog.info(LABEL, "onStart");
        super.onStart(intent);
        super.setMainRoute(OtherPageAbiltySlice.class.getName());

        addActionRoute("action.other.detail", OtherPageAbilitySliceDetail.class.getName());
    }

    @Override
    protected void onActive() {
        HiLog.info(LABEL, "onActive");
        super.onActive();
        Intent i = new Intent();
        i.setParam("data", "OtherPage");
        setResult(1,i);
    }

    @Override
    protected void onInactive() {
        HiLog.info(LABEL, "onInactive");
        super.onInactive();
    }

    @Override
    protected void onBackground() {
        HiLog.info(LABEL, "onBackground");
        super.onBackground();
    }

    @Override
    protected void onForeground(Intent intent) {
        HiLog.info(LABEL, "onForeground");
        super.onForeground(intent);
    }

    @Override
    protected void onStop() {
        HiLog.info(LABEL, "onForeground");
        super.onStop();
    }
}
